﻿using QuanLyPhongMach.Context;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace QuanLyPhongMach.Platform
{
    public class CTool
    {

        internal static List<Model.CBenhNhan> TimKiemBenhNhanBangTen(string p)
        {
            using (var db = new CBenhNhanContext(CConstant.CONNECTION))
            {
                return db.LayDanhSachBenhNhanTheoTen(p);
            }
        }

        internal static System.Collections.IEnumerable LayDanhSachTenBenhNhan()
        {
            using (var db = new CBenhNhanContext(CConstant.CONNECTION))
            {
                return db.LayDanhSachTenBenhNhan();
            }
        }

        internal static System.Collections.IEnumerable LayDanhSachDiaChi()
        {
            using (var db = new CBenhNhanContext(CConstant.CONNECTION))
            {
                return db.LayDanhSachDiaChi();
            }
        }

        internal static System.Collections.IEnumerable LayDanhSachTenLoaiBenh()
        {
            using (var db = new CBenhContext(CConstant.CONNECTION))
            {
                return db.LayDanhSachTenLoaiBenh();
            }
        }

        internal static List<Model.CBenhNhan> LayThongTinBenhNhanNangCao(string tenbenhnhan, string diachi, string tenloaibenh,
            DateTime namsinhtu, DateTime namsinhden, DateTime ngaykhamtu, DateTime ngaykhamden)
        {
            using (var db = new CBenhNhanContext(CConstant.CONNECTION))
            {
                return db.LayDanhSachBenhNhanNangCao(tenbenhnhan, diachi, tenloaibenh, namsinhtu, namsinhden, ngaykhamtu, ngaykhamden);
            }
        }

        internal static List<Model.CBenhNhan> LayThongTinBenhNhanNangCao(string tenbenhnhan, string diachi, string tenloaibenh)
        {
            using (var db = new CBenhNhanContext(CConstant.CONNECTION))
            {
                return db.LayDanhSachBenhNhanNangCao(tenbenhnhan, diachi, tenloaibenh);
            }
        }

        internal static List<Model.CBenhNhan> LayThongTinBenhNhanNangCao(DateTime namsinhtu, DateTime namsinhden, DateTime ngaykhamtu, DateTime ngaykhamden)
        {
            using (var db = new CBenhNhanContext(CConstant.CONNECTION))
            {
                return db.LayDanhSachBenhNhanNangCao(namsinhtu, namsinhden, ngaykhamtu, ngaykhamden);
            }
        }
    }
}
